﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace SK.Cores._Components
{
    public class FileUpload
    {
        HttpPostedFileBase _PostedFile;

        public FileUpload(HttpPostedFileBase postedFile)
        {
            _PostedFile = postedFile;
        }

        public HttpPostedFileBase PostedFile
        {
            get
            {
                return _PostedFile;
            }
            set
            {
                _PostedFile = value;
            }
        }
        public string FileName 
        {
            get 
            {
                return PostedFile.FileName;
            }
        }

        //public void Save(string relativePath)
        //{
        //    var path = HttpContext.Current.Server.MapPath(virtualPath);
        //    if (string.IsNullOrEmpty(path)) throw new System.IO.FileNotFoundException();
        //    File.SaveAs(string.Format("{0}{1}{2}", path, (path.EndsWith("/") ? string.Empty : "/"), File.FileName));
        //}
    }
}
